<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

</head>
<body>
  <input class="btn" type="text" value=""/>123
  <input class="btn-primary" type="submit" value="submit"/>
  <a href="http://www.baidu.com" onClick="return confirm('确定提交?');">提交</a>
  <span class="sub"></span>

</body>
</html>  
<script>
//     window.onload = function() {
//       document.querySelector('btn').onblur = function () {
//         alert('12')
//         }

// }
window.addEventListener('load',function (){
  let btn = document.querySelector('.btn')
  let live = true
  let submit = document.querySelector('.btn-primary');
  let sub = document.querySelector('.sub')
  console.log(sub)
  btn.addEventListener('blur',function() {
    console.log('123123')

    if (!live) {
      submit.style.display = 'block';
    } else {
      submit.style.display = 'none';
    }
  })

  })
  </script>